package xyz.robinbingo.rbtask.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ResEnum
 *
 * @author Robin
 * @date 2020/9/2 15:00
 **/
@Getter
@AllArgsConstructor
public enum ResEnum {

    /**
     * code,message
     */
    SUCCESS(1000, "成功"),

    // 2*** 请求端错误
    REQUEST_FAILED(2000, "请求失败"),
    ILLEGAL_REQUEST_METHOD(2001, "不支持的请求类型"),
    ILLEGAL_ARGUMENT(2002, "请求参数不合法"),
    ARGUMENT_NOT_READABLE(2003, "请求参数格式有误"),
    MISSING_PARAM(2004, "缺少请求参数"),

    // 3*** 数据库相关错误
    DATABASE_ERROR(3000, "数据库错误"),
    FAIL_TO_SAVE(3001, "数据保存失败"),

    // 4*** 业务相关错误
    BUSINESS_ERROR(4000, "业务有误"),

    FAIL(9999, "失败");

    private final Integer code;
    private final String message;
}
